<?php
/*
Bitsand - a web-based booking system for LRP events
Copyright (C) 2006, 2007 Russell Peter Phillips

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

include ('../inc/inc_head_db.php');
include ('../inc/inc_admin.php');
include ('../inc/inc_head_html.php');

$db_prefix = DB_PREFIX;

$sql = "SELECT plPlayerID, plFirstName, plSurname, plAdminNotes, chNotes FROM {$db_prefix}players, {$db_prefix}characters " .
	"WHERE (plAdminNotes <> '' OR chNotes LIKE '%Illegal set of skills entered%') AND plPlayerID = chPlayerID";
$result = ba_db_query ($link, $sql);
?>
<script src="../inc/sorttable.js" type="text/javascript"></script>

<h1><?php echo TITLE?> - Admin Notes &amp; Illegal Skills</h1>

<p>
Listed below are all players with an admin note, or who have an illegal set of skills entered.<br>
Click on a column header to sort by that column.
</p>

<table class = 'sortable'>
<tr><th>Player ID</th><th>OOC First Name</th><th>OOC Surname</th><th>Admin Note</th><th>IC Notes</th></tr>
<?php
//$bNone is True if no rows were displayed
$bNone = True;
while ($row = ba_db_fetch_assoc ($result)) {
	echo "<tr class = 'highlight'>\n";
	echo "<td>" . PID_PREFIX . sprintf ('%03s', $row ['plPlayerID']) . "</td>\n";
	echo "<td>" . htmlentities (stripslashes ($row ["plFirstName"])) . "</td>\n";
	echo "<td>" . htmlentities (stripslashes ($row ["plSurname"])) . "</td>\n";
	echo "<td>" . htmlentities (stripslashes ($row ["plAdminNotes"])) . "</td>\n";
	echo "<td>" . htmlentities (stripslashes ($row ["chNotes"])) . "</td>\n";
	echo "<td><a href = 'admin_viewdetails.php?pid=" . $row ['plPlayerID'] . "'>view OOC &amp; IC details</a></td>\n";
	echo "</tr>\n";
	$bNone = False;
}
if ($bNone)
	echo "<tr><td colspan = '6'><i>No players found</i></td></tr>\n";
echo "</table>\n";

include ('../inc/inc_foot.php');
?>
